const sql = require("./pkg/mysql/mysql");

// async function main() {
//   let arr = await sql.query(``);
//   console.log(arr);
// }
// main();
const superAgent = require("superagent");
superAgent.get("http://127.0.0.1:8090/res.json").then(async (res) => {
  for (let item of res.body.data.records) {
    await sql.query(`insert ignore into images values(${item.id},'${item.satelliteId}','${item.productId}','${item.productLevel}','${item.imagingTime}', ST_GeomFromGeoJSON('${item.imageGeo}'),'${item.thumb}')`);
  }
});
